package com.youlai.boot.modules.category.model;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

@Mapper(componentModel = "spring")
public interface CategoryConverter {
    CategoryForm toForm(Category entity);

    @Mapping(target = "createTime", ignore = true)
    @Mapping(target = "updateTime", ignore = true)
    Category toEntity(CategoryForm form);

    @Mapping(target = "typeName", ignore = true)
    CategoryVO toVO(Category entity);

    TreeItemVO toTreeItem(Category category);
}
